Properly separate sorted xattr names
authorStef Walter <stefw@redhat.com>
Tue, 13 Aug 2013 13:40:06 +0000 (15:40 +0200)
committerStef Walter <stefw@redhat.com>
Tue, 13 Aug 2013 13:42:54 +0000 (15:42 +0200)
We expect to be handling a string delimited by \0 characters, as
returned by llistxattr(). So stick to that behavior here.

https://bugzilla.gnome.org/show_bug.cgi?id=705893

src/libostree/ostree-core.c

index eef974aae0e54a1bc2c4b3aa821a8c29dd3a76f7..7fb4e2f9b41fe2b1eba641f5dd0d882e2ce05b2a 100644 (file)
@@ -158,8 +158,10 @@ canonicalize_xattrs (char *xattr_string, size_t len)
     }
 
   xattrs = g_slist_sort (xattrs, (GCompareFunc) strcmp);
-  for (iter = xattrs; iter; iter = iter->next)
+  for (iter = xattrs; iter; iter = iter->next) {
     g_string_append (result, iter->data);
+    g_string_append_c (result, '\0');
+  }
 
   g_slist_free (xattrs);
   return g_string_free (result, FALSE);